<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>

    <input type="text">
    
<script>
    const input = document.querySelector("input")
    input.addEventListener("input", function() {
        console.log("用户输入了文本")
        console.log(input.value)
    })

</script>
</body>
</html>